package cn.liujianbo.example.pattern.strategy.cash;

/**
 * @author 刘建波
 * @date 2022-04-02 10:27
 */
public class CashReturn  implements CashInterface{

    private double conditionMoney = 0.0;
    private double moneyReturn = 10;

    public CashReturn(double conditionMoney) {
        this.conditionMoney = conditionMoney;
    }

    @Override
    public double acceptCash(double money) {
        double result = money;
        if (money > conditionMoney) {
            result = money - moneyReturn;
        }
        return result;
    }
}
